<template>
    <van-nav-bar
  title="标题"
  left-text="返回"
  left-arrow
  @click-left="onClickLeft"
/>
<van-skeleton title :row="3" />
    <div v-html="detailApiData.goods_introduce">

    </div>
    <van-action-bar>
  <van-action-bar-icon icon="chat-o" text="客服" dot />
  <van-action-bar-icon icon="cart-o" text="购物车" badge="5" />
  <van-action-bar-icon icon="shop-o" text="店铺" badge="12" />
  <van-action-bar-button type="warning" text="加入购物车" @click="gwc"/>
  <van-action-bar-button type="danger" text="立即购买" />
</van-action-bar>
</template>

<script setup>
import router from '@/router';
import { ref } from 'vue';
import { detailApi } from '@/api/api';
import { useRoute } from 'vue-router';
let route=useRoute()
let detailApiData=ref([])
detailApi(route.params.goods_id).then(res=>{
    detailApiData.value=res.data.message
    console.log(res);
    
})
import { useCounterStore } from '@/stores/cart'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()
const onClickLeft = () => history.back();
const gwc=()=>{
    store.piniaApp(detailApiData.value,route.params.goods_id)
    router.push('/splb')
}
</script>

<style lang="scss" scoped>

</style>